package pay.commont;

public enum GoodsType {
    VIP(1, "会员"),
    GAME(2, "赛事"),
    ADDITION(3, "增值服务包"),
    ACTIVATE(4, "活动项目"),
    SPACE(5, "场地预约"),
    CLUB_ACTIVATE(6, "俱乐部活动项目"),
    POST(7, "邮寄");
    private Integer type;
    private String desc;

    private GoodsType(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static GoodsType getGoodsType(Integer type) {
        for (GoodsType goodsType : values()) {
            if (goodsType.type.equals(type)) {
                return goodsType;
            }
        }
        throw new IllegalArgumentException("未知goodsType：" + type);
    }
}
